<template>
  <div>
    <Header />
    <!-- 加载渲染路由组件 -->
    <router-view />
    <!-- 
      需求：登录和注册不要Footer组件
      解决：判断当前是否是登录或注册组件
        $route
          path 获取当前路由路径
          query
          params
          meta 
            获取路由参数
        $router
          用来路由跳转（编程式导航）
    -->
    <Footer v-if="!$route.meta.isHiddenFooter" />
  </div>
</template>

<script>
import Header from '@/components/Header'
import Footer from '@/components/Footer'

export default {
  name: 'App',
  components: {
    Header,
    Footer,
  },
  computed: {
    isShowFooter() {
      const path = this.$route.path
      return path !== '/login' && path !== '/register'
      // return this.$route.path !== "/login" && this.$route.path !== "/register";
    },
  },
}
</script>

<style></style>
